#include "AdapterPtr.h"

namespace serika
{
	namespace db
	{
		AdapterPtr::AdapterPtr(Adapter*& adapter)
			: mAdapter(&adapter)
		{
		}
	
		AdapterPtr::~AdapterPtr()
		{
		}
	
		Adapter* AdapterPtr::operator ->()
		{
			return *mAdapter;
		}
	
		Adapter& AdapterPtr::operator *()
		{
			return **mAdapter;
		}
	
		AdapterPtr& AdapterPtr::operator =(Adapter*& adapter)
		{
			mAdapter = &adapter;
			return *this;
		}
	
		AdapterPtr& AdapterPtr::operator =(const AdapterPtr& ptr)
		{
			mAdapter = ptr.mAdapter;
			return *this;
		}
	
		bool AdapterPtr::operator ==(const void* rawPtr) const
		{
			return *mAdapter == rawPtr;
		}
	
		bool AdapterPtr::operator ==(const AdapterPtr& ptr) const
		{
			return mAdapter == ptr.mAdapter;
		}
	
		AdapterPtr::operator Adapter*()
		{
			return *mAdapter;
		}
	}
}
